package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import java.io.IOException;
import java.net.Socket;

public class MainActivity extends AppCompatActivity{
    private EditText ip;
    private EditText port;
    EditText send_text;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ip=findViewById(R.id.ip);
        port=findViewById(R.id.port);
        send_text=findViewById(R.id.send_text);
    }


    public void onClick_connect(View view){
        new Thread(() -> {
            try {
                acceptserver();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }).start();
    }
    private void  acceptserver()throws IOException{

        Socket socket=new Socket(ip.getText().toString(),Integer.parseInt(port.getText().toString()));

    }
}